from projects.electrophysiology.view_data.experiment import Experiment
import pylab
import matplotlib
import numpy

# get the experiment of interest
expe_num = 738
experiment = Experiment.from_default_db(expe_num)
voltage = experiment.data[0]

#construct a times list
sample_rate = experiment.data[1]
time = numpy.linspace(0,len(voltage)/sample_rate,len(voltage))

#Downsample the data for plotting and editing in illustrator
ds_factor=50
ds_voltage=voltage[0:len(voltage):ds_factor]
ds_time=time[0:len(time):ds_factor]
#Plot
pylab.plot(ds_time,ds_voltage,'k')
#pylab.setp(pylab.gca(),'xticklabels',[])
pylab.xlabel('Time (s)',fontsize=16)
pylab.ylabel('Voltage (mV)',fontsize=16)
pylab.show()



